#pragma once
#include<map>
#include<set>
#include<string>
#include<vector>
using namespace std;

int character[256] = { 0 };
set<string> op({ "+",    "-",    "*",    "/","&",    "|",    "^",    "!","%",    "=",    "?",    ">",       "<",   ".",    ":","\\",">=",   "<=",   ">>",   "<<",   "==","&&",   "||",   "++",   "==",   "--","+=",   "-=",   "*=",   "/=",   "%=","&=",   "|=",   "^=",   "!=",   "<<=",">>=",  ":=",   "->" });
set<string> delimiter({ "(",    ")",    "{",    "}",    "[",    "]",    ";",    ",","\"",   "\'" });
set<string> reseve_words({ "if","else","while","for","switch","case","do","goto","break","continue","static","union","struct","default","enum","extern","return","sizeof","typedef","int","float","double","long","unsigned","signed","short","char","void" });

void init()
{
	for (int i = 0; i <= 256; i++)
	{
		char ch = (char)i;
		string temp = "";
		temp += ch;
		if (ch == '\t' || ch == '\r' || ch == '\n' || ch == ' ')
			character[i] = 0;
		else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_')
			character[i] = 1;
		else if (ch >= '0' && ch <= '9')
			character[i] = 2;
		else if (op.find(temp) != op.end())
			character[i] = 3;
		else if (delimiter.find(temp) != delimiter.end())
			character[i] = 4;
		else
			character[i] = -1;
	}
}